You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Classes > Matrix Structure > Matrix Methods > Size Method > Matrix.Size Method ([In] int, [In] int, [In] bool, [In] bool)
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
Matrix.Size Method ([In] int, [In] int, [In] bool, [In] bool)

Sets the size of matrix.

Syntax
C#
Visual Basic
public TMtx Size([In] int aRows, [In] int aCols, [In] bool AComplex, [In] bool aIsDouble);

Set the calling matrix properties: 

Rows = ARows, Cols = ACols and See cref="Complex"/> = AComplex

Calling the Size method does not preserve the contents of the matrix. Use the Resize method, if you want to preserve existing values. 

The floating point precision is defined with aIsDouble. 

Note The Size method performs an out-of-memory safe resize, if the matrix already has memory allocated. This prevents out of memory message for example when redefining the size of the matrix from single column to single row: 

 

A.Rows := 10000; // matrix size = 0 A.Cols := 1; // matrix size = 10000 // ... A.Cols := 10000; // matrix size = 100 000 000 (problems here) A.Rows := 1; // matrix size = 10 000
var A: Matrix; begin A.Size(2,1,True, true); // 2x1 complex double matrix A.SetZero; // A becomes: // [0,0] // [0,0] end;
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!